<script type="text/javascript">
	

    function ajaxFilterDistrictNcdt(city_id)
    {
        $.ajax({
        url: '<?php echo $this->Html->url(array("controller" => "districts", "action" => "ajaxDistrictOption", "admin" => false));?>/'+city_id,        
        success: function( data ) {
            if (console && console.log){
              $("#NcdtDistrictId").html(data);
	      //alert($("#ProductDistrictId").val());
	      //ajaxFilterProject($("#ProductDistrictId").val());
            }
          }
        });
    }
    
    function ajaxFilterCareerNcdt(city_id)
    {
        $.ajax({
        url: '<?php echo $this->Html->url(array("controller" => "careers", "action" => "ajaxCareerOption", "admin" => false));?>/'+city_id,        
        success: function( data ) {
            if (console && console.log){
              $("#NcdtCareerId").html(data);
	      //alert($("#ProductDistrictId").val());
	      //ajaxFilterProject($("#ProductDistrictId").val());
            }
          }
        });
    }

</script>
<div class="box_search">
					<form action="<?php echo $this->Html->url(array('controllers'=>'ncdts', 'action' => 'index')); ?>" method="POST" id="filter_index">
						<div class="detail_search">
							<p class="key_title">Nhà phân phối</p>
							
							<div class="select_box">

								<input type="text" name="filter_keyword" value="" class="keyword" />
								<select onchange="ajaxFilterDistrictNcdt(this.value);ajaxFilterCareerNcdt(this.value);$('#filter_index').submit();" name="filter_city_id">
								    <option value="all"><?php __('Tỉnh/Thành'); ?></option>
								    <?php foreach($cities as $c ) {
									
								    ?>
									<option value="<?php echo $c["City"]["id"] ?>" ><?php echo $c["City"]["name"] ?></option>
								    <?php } ?>
								</select>
								<select onchange="$('#filter_index').submit();" name="filter_district_id" id="NcdtDistrictId">
								    <option value="all">- <?php __('Quận/Huyện'); ?> -</option>
								    <?php foreach($districts as $d ) {
									
								    ?>
									<option value="<?php echo $d["District"]["id"] ?>" ><?php echo $d["District"]["name"] ?></option>
								    <?php } ?>
								</select>
								<select onchange="$('#filter_index').submit();" name="filter_career_id" id="NcdtCareerId">
								    <option value="all">- <?php __('Ngành nghề'); ?> -</option>
								    <?php foreach($careers as $ca ) {
									
								    ?>
									<option value="<?php echo $ca["Career"]["id"] ?>" ><?php echo $ca["Career"]["name"] ?></option>
								    <?php } ?>
								</select>
							</div><!--end select_box-->
						</div><!-- end detail_search-->
					</form>

				</div><!--end box_search-->	